package com.kehutong.house.enums;

import org.coraframework.util.HashID;

public enum SalesStatus implements HashID {

    SOLD ("0", "已售"),
    UNSOLD("1", "未售"),
    ;


    private final String id;
    private final String desc ;

    private SalesStatus(String id, String desc) {
        this.id = id;
        this.desc = desc ;
    }

    public static SalesStatus get(String desc) {
        SalesStatus[] salesStatuses = values();
        for (SalesStatus salesStatus : salesStatuses) {
            if (salesStatus.getDesc().equals(desc)) {
                return salesStatus;
            }
        }
        return null;
    }

    @Override
    public String getId() {
        return id;
    }

    @Override
    public String getDesc() {
        return desc;
    }
}
